package com.triz.business.service.impl;

import java.util.List;
import com.triz.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.triz.business.mapper.FunctionalModelMapper;
import com.triz.business.domain.FunctionalModel;
import com.triz.business.service.IFunctionalModelService;

/**
 * 功能建模Service业务层处理
 * 
 * @author hlk
 * @date 2025-11-15
 */
@Service
public class FunctionalModelServiceImpl implements IFunctionalModelService 
{
    @Autowired
    private FunctionalModelMapper functionalModelMapper;

    /**
     * 查询功能建模
     * 
     * @param id 功能建模主键
     * @return 功能建模
     */
    @Override
    public FunctionalModel selectFunctionalModelById(Long id)
    {
        return functionalModelMapper.selectFunctionalModelById(id);
    }

    /**
     * 查询功能建模列表
     * 
     * @param functionalModel 功能建模
     * @return 功能建模
     */
    @Override
    public List<FunctionalModel> selectFunctionalModelList(FunctionalModel functionalModel)
    {
        return functionalModelMapper.selectFunctionalModelList(functionalModel);
    }

    /**
     * 新增功能建模
     * 
     * @param functionalModel 功能建模
     * @return 结果
     */
    @Override
    public int insertFunctionalModel(FunctionalModel functionalModel)
    {
        functionalModel.setCreateTime(DateUtils.getNowDate());
        return functionalModelMapper.insertFunctionalModel(functionalModel);
    }

    /**
     * 修改功能建模
     * 
     * @param functionalModel 功能建模
     * @return 结果
     */
    @Override
    public int updateFunctionalModel(FunctionalModel functionalModel)
    {
        functionalModel.setUpdateTime(DateUtils.getNowDate());
        return functionalModelMapper.updateFunctionalModel(functionalModel);
    }

    /**
     * 批量删除功能建模
     * 
     * @param ids 需要删除的功能建模主键
     * @return 结果
     */
    @Override
    public int deleteFunctionalModelByIds(Long[] ids)
    {
        return functionalModelMapper.deleteFunctionalModelByIds(ids);
    }

    /**
     * 删除功能建模信息
     * 
     * @param id 功能建模主键
     * @return 结果
     */
    @Override
    public int deleteFunctionalModelById(Long id)
    {
        return functionalModelMapper.deleteFunctionalModelById(id);
    }

    @Override
    public List<FunctionalModel> selectfunctionalModelFlawList(FunctionalModel functionalModel) {
        return functionalModelMapper.selectfunctionalModelFlawList(functionalModel);
    }
}
